﻿using BarManager.Core.BusinessRules.Interfaces.Validator;
using BarManager.Core.BusinessRules.Specification;
using BarManager.Core.DomainService;
using BarManager.Core.Entity;

namespace BarManager.Core.BusinessRules.Validator
{
    public class CargoValidator : BaseValidator<Cargo>, ICargoValidator
    {
        public CargoValidator(ICargoRepository repository)
        {
            Rules.Add(new Rule<Cargo>(ValidatorType.Add, new CargoAddSpecification(repository)));
            Rules.Add(new Rule<Cargo>(ValidatorType.Update, new CargoAddSpecification(repository)));
            Rules.Add(new Rule<Cargo>(ValidatorType.Delete, new CargoDeleteSpecification(repository)));
        }
    }
}
